#include<stdio.h>
#include<string.h>

int main()
{
	int sign=0,flag=0,key=0;
	char c[60]={'\0'},z[40]={'\0'},h[40]={'\0'};
	gets(c);
	for(sign=0;sign<strlen(c);sign++)
	{
		if(c[sign]=='('||c[sign]==')'||c[sign]=='['||c[sign]==']'||c[sign]=='{'||c[sign]=='}')
		z[flag++]=c[sign];
	}
	for(sign=0;sign<strlen(z);sign++)
	{
		if(z[sign]=='(') h[key++]=')';
		if(z[sign]=='[') h[key++]=']';
		if(z[sign]=='{') h[key++]='}';
		if(z[sign]==h[key-1]) key--;
	}
	if(key!=0) printf("no");
	else printf("yes");
	return 0;
}
